import time
def get_time():
    while True:
        # t = time.localtime()
        t1 = time.strftime('%Y-%m-%d %H:%M:%S')
        print(t1)
        if t1 == '2024-12-04 16:24:40':
            print('YES')
            break
        time.sleep(1)
get_time()

t1 = time.strptime('2024-12-03 22:00:00', '%Y-%m-%d %H:%M:%S')
t2 = time.strptime('2024-12-04 03:00:00', '%Y-%m-%d %H:%M:%S')
with open('log.txt', mode='r') as fr:
    # print(fr.readlines())
    for line in fr.readlines():
        # print(line[:19])
        #
        t = time.strptime(line[:19], '%Y-%m-%d %H:%M:%S')
        # print(t)
        if t1 <= t <= t2:
            print(line, end='')
